package database

import (
	"log"

	"github.com/go-redis/redis"
)

var re *redis.Client

func InitRedis() {
	client := redis.NewClient(&redis.Options{
		Addr:     "127.0.0.1:6379",
		Password: "", // no password set
	})
	_, err := client.Ping().Result()
	if err != nil {
		log.Fatal(err)
	} else {
		re = client
	}
}
func GetRedis() *redis.Client {
	return re
}
